Repository navigation
Home
Check out the following code samples to get started, or if you are upgrading from v1.x, you may wish to check out the upgrade guide to see what has changed between versions.
Shows how to load an existing assembly into a Roslyn C# script domain.
The following examples show how to compile various forms of input source code but not execute. This works on all platforms including IL2CPP if you just need to produce assemblies or verify that C# code is valid.
- Compile Source
- Compile File
- Compile Syntax Tree
- Compile C# Project
- Compile Folder
- Compile Async
- Compile Options
_The following examples show how to compile and load various forms on input source code for execution. This is limited to Mono platforms buy default, but can be supported on any platform if using dotnow. See the dedicated dotnow integration guide for more info.
- Compile And Load Source
- Compile And Load File
- Compile And Load Syntax Tree
- Compile And Load C# Project
- Compile And Load Folder
- Compile And Load Async
The following examples show how to compile, load and return the main type defined in compiled code. This is useful if you are just compiling single source inputs that will only have 1 class for example, but is also useful in other cases since by default it will select MonoBehaviour types to be the main type.
The following examples cover assembly referencing which allows compiled code to reference any assembly that is part of the game, external and also other compiled assemblies.
More samples to come soon...